import request from '@/utils/request'

// 登陆
export const loginAPI = data =>
  request({
    url: '/sys/login',
    method: 'post',
    data
  })

// 获取用户基本信息
export const getUserInfoAPI = () =>
  request({
    url: '/sys/profile',
    method: 'post'
  })

// 登出
export const logoutAPI = () => request()

// 获取员工基本信息
export const getUserInfoByIdAPI = id =>
  request({
    url: `/sys/user/${id}`,
    method: 'get'
  })
// 保存员工基本信息
export const updateUserInfoAPI = (id, data) =>
  request({
    url: `/sys/user/${id}`,
    method: 'put',
    data
  })

// *给员工分配权限角色
export const assignUserRoleAPI = data =>
  request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
